]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Background: don't require a URI scheme for picture-uri
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 13 Jun 2013 19:48:32 +0000 (21:48 +0200)
committerRay Strode <rstrode@redhat.com>
Tue, 18 Jun 2013 14:55:52 +0000 (10:55 -0400)
Migration from old settings can result in a path instead of URI
there. This is technically invalid, but can easily recognize it
and avoid the crash.

Minor changes by Ray Strode

https://bugzilla.gnome.org/show_bug.cgi?id=702121

js/ui/background.js

index 0e9c3aa953fbf601387ccb112f38d52b7c4dd61c..1d9ab7c210395a480ddbc0afff3d153844a66e46 100644 (file)
@@ -571,7 +571,16 @@ const Background = new Lang.Class({
         }
 
         let uri = this._settings.get_string(PICTURE_URI_KEY);
-        let filename = Gio.File.new_for_uri(uri).get_path();
+        let filename;
+        if (GLib.uri_parse_scheme(uri) != null)
+            filename = Gio.File.new_for_uri(uri).get_path();
+        else
+            filename = uri;
+
+        if (!filename) {
+            this._setLoaded();
+            return;
+        }
 
         this._loadFile(filename);
     },